package com.example.orders.controller;


import com.example.orders.pojo.TbOrder;
import com.example.orders.service.impl.TbOrderServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 梁峰
 * @since 2021-12-10
 */
@RestController
@RequestMapping("/orders")
public class TbOrderController {
    @Autowired
    private TbOrderServiceImpl tbOrderService;
    @GetMapping("/{id}")
    public TbOrder getById(@PathVariable("id") long id){
        //TbOrder byId = tbOrderService.getById(id);
        TbOrder order = tbOrderService.getOrder(id);
        return order;
    }
}
